{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from scipy.stats import binom  # 导入伯努利分布的实例\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "plt.rcParams['figure.figsize']=(15,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "n,p1,p2=10,0.25,0.9   #设置相关参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3gAAAFbCAYAAACHySz/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3X+4XVV97/v3R4OiJErUKIUAkVMLqdrjj1gtggrX2hYQMC1tRDnVhlLPVVGkHr3aWmt72l4rVrEXarBCKR4UBXqkpMS2T0CirRIERLTQYuRHbDgBKwpowfi9f8y5zWK5d7L2yt5r7cz9fj3PfOZaY445xpi6WSPfOecYI1WFJEmSJGn394hxN0CSJEmSNDMM8CRJkiSpIwzwJEmSJKkjDPAkSZIkqSMM8CRJkiSpIwzwJEmSJKkjDPA07yX5hSRXJrkvydYkf55kz3G3S5KkcbJ/lHZPBnia15KcDlwB/DtwGnAZ8HrggyOq/xFJTkvyL0m+n+SOJGck2WvA838qyXuS/HPb+X43yfVJ3jlZGUlqiu2+2WifJGn3tLv3j20ZT0nyF+25Dya5PckHk+y9q/XZP2ouiwuda75K8lLgM8D/qKr39aRfARwBLKmq78xyGz4InApcCvwdsBx4I3A18NKq+uFOzv8Tmg7308A/Aw/RtP1XgS8DL6iq7/Xkr7bsNX1FPVRVn5jp9kmSdj8d6R+fDHwR2Bf4MPAV4BnAbwE3AS+sqgeGrc/+UXN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NKcZ4Emj99iez9smPlTVe4EP0MwW9lM9edJ3/g96PjvGQJLUFct6Pt83VabWRCD3WLYHhb3nBXjqzDRL2r0Y4Emj1zsb2I9msk1yEnAN8Jmq+uAOzu+d/fa7M9w2SZLGZdIboFPovdm5xxTp3gTVvGSAJ43ercDE8gaL4Edj8NbQdFJ/m6T/qV2viVdOtlbVTqeOliRpNzHpDdApTASDBXxjivO8Cap5yQBPGrGquh/Y2H79iXZ/ILBn+/mvaBZrvb/9/lNJntNTxJPb/Wdns52SJI3Yj90A7dM7Jn3fdn9VVW3tSZ+4CfpD4Osz2zxp92CAJ43H+e3+6e3+euBS4AHgTuAtwJ8C3wOWtmkTDmn3fzX7zZQkaTSmuAHaa3mSxe1bLq+g6SPf0pdn4ibodVW1s3F8UicZ4Enj8RGapRCOBqiqH1bVyqraq6qOq6pNVfX7VfXYqnpRVfXOJvYy4AtVddlkBUuStBvrvwEKzRstJwK/DfwNTRB4P3BEVV3Xd743QTXvpZlpVtKoJXkx8BngOVV104DnHEGzIPqKqrp5NtsnSdKoJXk0cDPwjap6yRDnXwEsBw6uqu/PcPOk3YJP8KQxqaqraBZiPTPJY3eWP8mTgT8Bjja4kyR1UVX9J/DrwM8lefrO8vdK8jTgxcB/M7jTfOYTPGnMkvw08LKq+sBO8r0D+OuqumM0LZMkaTySnAC8Dnh5VT0wQP69aN5w+XBVXTTb7ZPmMgM8SZIkzTmD3gBt874R+Meq+urst0ya2wzwJEmSJKkjHIMnSZIkSR1hgCdJkiRJHWGAJ0mSJEkdYYAnSZIkSR1hgCdJkiRJHfH/A65MlfhqBEFjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fontdict = {'family': 'Times New Roman', 'weight': 'normal', 'size': 18}\n",
    "x1 = np.arange(binom.ppf(0,n,p1),\n",
    "             binom.ppf(1,n,p1)+1)\n",
    "ax1=plt.subplot(121)\n",
    "#ax1.plot(x1,binom.pmf(x1,n,p1),'bo',ms=1)\n",
    "ax1.vlines(x1, 0, binom.pmf(x1, n, p), colors='b', lw=20, alpha=1)\n",
    "ax1.set_xlim((-0.9,10.9))\n",
    "ax1.set_ylim((0,0.35))\n",
    "ax1.xaxis.set_major_locator(plt.MultipleLocator(1.0))\n",
    "ax1.set_xlabel('(a)',fontdict=fontdict)\n",
    "ax1.tick_params(labelsize=15)\n",
    "ax1.set_title(r'$\\theta=0.250$',fontdict=fontdict)\n",
    "\n",
    "x2 = np.arange(binom.ppf(0,n,p2),\n",
    "             binom.ppf(1,n,p2)+1)\n",
    "ax2=plt.subplot(122)\n",
    "#ax2.plot(x2,binom.pmf(x2,n,p2),'bo',ms=1)\n",
    "ax2.vlines(x2, 0, binom.pmf(x2, n, p2), colors='b', lw=20, alpha=1)\n",
    "ax2.set_xlim((-0.9,10.9))\n",
    "ax2.set_ylim((0,0.4))\n",
    "ax2.xaxis.set_major_locator(plt.MultipleLocator(1.0))\n",
    "ax2.set_xlabel('(b)',fontdict=fontdict)\n",
    "ax2.tick_params(labelsize=15)\n",
    "ax2.set_title(r'$\\theta=0.900$',fontdict=fontdict)\n",
    "\n",
    "labels = ax1.get_xticklabels() + ax1.get_yticklabels()+ax2.get_xticklabels() + ax2.get_yticklabels()\n",
    "temp=[label.set_fontname('Times New Roman') for label in labels]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
